class Amimal {//父类
    public String name;
    public int age;

    public void eat() {
        System.out.println("eat");
    }
}
class Dog extends Amimal{//子类继承父类

    public void wangwang() {
        System.out.println("wangwang");
    }

}

class Cat extends Amimal{//子类继承父类
    public void miaomiao() {
        System.out.println("miaomiao");
    }
}
public class Test3 {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name = "lala";
        dog.eat();
        dog.wangwang();

        Cat cat = new Cat();
        cat.name = "kaka";
        cat.eat();
        cat.miaomiao();
    }
}
